package com.example.blogdevelop.service.impl;

import com.example.blogdevelop.entity.Blog;
import com.example.blogdevelop.entity.Tag;
import com.example.blogdevelop.mapper.BlogMapper;
import com.example.blogdevelop.mapper.TagMapper;
import com.example.blogdevelop.service.BlogService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class BlogServiceImpl extends ServiceImpl<BlogMapper, Blog> implements BlogService {

    @Autowired
    private BlogMapper blogMapper;
    @Autowired
    private TagMapper tagMapper;

    @Override
    public void deleteMain(int blogId){
        blogMapper.deleteById(blogId);
        tagMapper.deleteByBlogId(blogId);
    }
}
